#ifndef _BOOST_DEF_H_
#define _BOOST_DEF_H_

#define BOOST_ERROR_CODE_HEADER_ONLY
#define BOOST_USE_WINAPI_VERSION								0x0501
#define BOOST_ALL_NO_LIB	
#define BOOST_REGEX_NO_LIB
#define BOOST_DATE_TIME_SOURCE
#define BOOST_SYSTEM_NO_LIB
//#define BOOST_ASIO_ENABLE_CANCELIO
#define BOOST_SYSTEM_NO_DEPRECATED

#include <boost/bind.hpp>
#include <boost/asio.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <boost/asio/error.hpp>

using boost::asio::ip::tcp;

typedef boost::asio::io_service									io_service;
typedef io_service*												io_service_ptr;

typedef boost::asio::io_service::strand 						io_strand;
typedef io_strand*												io_strand_ptr;

typedef boost::asio::io_service::work							io_work;
typedef boost::asio::io_service::work*							io_work_ptr;

typedef boost::asio::ip::tcp::socket							io_socket;
typedef io_socket*												io_socket_ptr;

typedef boost::asio::ip::udp::socket							io_usocket;
typedef io_usocket*												io_usocket_ptr;

typedef boost::asio::ip::tcp::acceptor							io_acceptor;
typedef io_acceptor*											io_acceptor_ptr;

typedef boost::asio::deadline_timer								io_time;
typedef io_time*												io_time_ptr;

typedef boost::asio::steady_timer								io_steady_time;
typedef io_steady_time*											io_steady_time_ptr;

typedef boost::asio::ip::tcp::resolver							io_resolver;
typedef io_resolver*											io_resolver_ptr;

typedef const boost::system::error_code&						io_c_error_code;

typedef boost::system::error_code								io_error_code;

/*

 BSD Socket API Elements
	

Equivalents in Boost.Asio

socket descriptor - int (POSIX) or SOCKET (Windows)
	

For TCP: ip::tcp::socket, ip::tcp::acceptor

For UDP: ip::udp::socket

basic_socket, basic_stream_socket, basic_datagram_socket, basic_raw_socket

in_addr, in6_addr
	

ip::address, ip::address_v4, ip::address_v6

sockaddr_in, sockaddr_in6
	

For TCP: ip::tcp::endpoint

For UDP: ip::udp::endpoint

ip::basic_endpoint

accept()
	

For TCP: ip::tcp::acceptor::accept()

basic_socket_acceptor::accept()

bind()
	

For TCP: ip::tcp::acceptor::bind(), ip::tcp::socket::bind()

For UDP: ip::udp::socket::bind()

basic_socket::bind()

close()
	

For TCP: ip::tcp::acceptor::close(), ip::tcp::socket::close()

For UDP: ip::udp::socket::close()

basic_socket::close()

connect()
	

For TCP: ip::tcp::socket::connect()

For UDP: ip::udp::socket::connect()

basic_socket::connect()

getaddrinfo(), gethostbyaddr(), gethostbyname(), getnameinfo(), getservbyname(), getservbyport()
	

For TCP: ip::tcp::resolver::resolve(), ip::tcp::resolver::async_resolve()

For UDP: ip::udp::resolver::resolve(), ip::udp::resolver::async_resolve()

ip::basic_resolver::resolve(), ip::basic_resolver::async_resolve()

gethostname()
	

ip::host_name()

getpeername()
	

For TCP: ip::tcp::socket::remote_endpoint()

For UDP: ip::udp::socket::remote_endpoint()

basic_socket::remote_endpoint()

getsockname()
	

For TCP: ip::tcp::acceptor::local_endpoint(), ip::tcp::socket::local_endpoint()

For UDP: ip::udp::socket::local_endpoint()

basic_socket::local_endpoint()

getsockopt()
	

For TCP: ip::tcp::acceptor::get_option(), ip::tcp::socket::get_option()

For UDP: ip::udp::socket::get_option()

basic_socket::get_option()

inet_addr(), inet_aton(), inet_pton()
	

ip::address::from_string(), ip::address_v4::from_string(), ip_address_v6::from_string()

inet_ntoa(), inet_ntop()
	

ip::address::to_string(), ip::address_v4::to_string(), ip_address_v6::to_string()

ioctl()
	

For TCP: ip::tcp::socket::io_control()

For UDP: ip::udp::socket::io_control()

basic_socket::io_control()

listen()
	

For TCP: ip::tcp::acceptor::listen()

basic_socket_acceptor::listen()

poll(), select(), pselect()
	

io_service::run(), io_service::run_one(), io_service::poll(), io_service::poll_one()

Note: in conjunction with asynchronous operations.

readv(), recv(), read()
	

For TCP: ip::tcp::socket::read_some(), ip::tcp::socket::async_read_some(), ip::tcp::socket::receive(), ip::tcp::socket::async_receive()

For UDP: ip::udp::socket::receive(), ip::udp::socket::async_receive()

basic_stream_socket::read_some(), basic_stream_socket::async_read_some(), basic_stream_socket::receive(), basic_stream_socket::async_receive(), basic_datagram_socket::receive(), basic_datagram_socket::async_receive()

recvfrom()
	

For UDP: ip::udp::socket::receive_from(), ip::udp::socket::async_receive_from()

basic_datagram_socket::receive_from(), basic_datagram_socket::async_receive_from()

send(), write(), writev()
	

For TCP: ip::tcp::socket::write_some(), ip::tcp::socket::async_write_some(), ip::tcp::socket::send(), ip::tcp::socket::async_send()

For UDP: ip::udp::socket::send(), ip::udp::socket::async_send()

basic_stream_socket::write_some(), basic_stream_socket::async_write_some(), basic_stream_socket::send(), basic_stream_socket::async_send(), basic_datagram_socket::send(), basic_datagram_socket::async_send()

sendto()
	

For UDP: ip::udp::socket::send_to(), ip::udp::socket::async_send_to()

basic_datagram_socket::send_to(), basic_datagram_socket::async_send_to()

setsockopt()
	

For TCP: ip::tcp::acceptor::set_option(), ip::tcp::socket::set_option()

For UDP: ip::udp::socket::set_option()

basic_socket::set_option()

shutdown()
	

For TCP: ip::tcp::socket::shutdown()

For UDP: ip::udp::socket::shutdown()

basic_socket::shutdown()

sockatmark()
	

For TCP: ip::tcp::socket::at_mark()

basic_socket::at_mark()

socket()
	

For TCP: ip::tcp::acceptor::open(), ip::tcp::socket::open()

For UDP: ip::udp::socket::open()

basic_socket::open()

socketpair()
	

local::connect_pair()

Note: POSIX operating systems only. 

*/
#endif // !_BOOST_DEF_H_
